git delete all branches except master

35

git branch | grep -v "master" | xargs git branch -D
git branch | grep -v “master” | xargs git branch -D
git branch | %{ $_.Trim() } | ?{ $_ -ne 'master' } | %{ git branch -D $_ }
$ git branch | grep -v '^*' | xargs git branch -D
git branch -r | grep 'origin' | grep -v 'master$' | grep -v HEAD | cut -d/ -f2- | while read line; do git push origin :heads/$line; done;

Comments

Submit
0 Comments